package PTA.ch05;

import java.lang.reflect.Array;
import java.util.Scanner;

class IllegalScoreException extends Exception{
    public IllegalScoreException(){}
}


class IllegalNameException extends Exception{
    public IllegalNameException(){}
}

class Student{
    private String name;
    private int score;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        char c = name.charAt(0);
        if(c>='0'&&c<='9')
        {
            try{
                throw new IllegalNameException();
            }catch(IllegalNameException e){
                System.out.println("IllegalNameException: the first char of name must not be digit, name="+name);

            }
            return;
        }
        this.name = name;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        if(score<0||score>100)
        {
          try{
              throw new IllegalScoreException();
          }catch(IllegalScoreException e)
          {
              System.out.println("IllegalScoreException: score out of range, score="+score);
          }
        }
        this.score = score;
    }
    public int addScore(int score){
        return 0;
    }
    @Override
    public String toString(){
        return "Student [" +
                "name=" + name  +
                ", score=" + score +
                ']';
    }
}



public class ex03 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        if(s.equals("new")){
String str = sc.nextLine();
String []s1=s.split(" ");

        }
    }

}
